KERDIR = /lib/modules/$(shell uname -r)/build

obj-m += v4l2-device.o
obj-m += v4l2-driver.o

v4l2-device-objs += v4l2_device.o
v4l2-driver-objs += v4l2_driver.o v4l2_fops.o

ifneq (${KERNELRELEASE},)
ccflags-y := -DBUILD_VERSION="\"$(shell cd $(PWD) && ./version.sh)\""
endif

all:
	$(MAKE) -C $(KERDIR) M=$(CURDIR) modules
	@ls *.ko
clean:
	$(MAKE) -C $(KERDIR) M=$(CURDIR) clean
